package com.ym521.demo

import android.app.Application
import android.content.Context
import android.util.Log
import com.ym521.sadcrash.SadCrash
import com.ym521.sadcrash.callback.CrashCallback

/**
 *@author Ym
 *E-mail: 2435970206@qq.com
 *createTime:2023/6/11
 *explain:
 */
class MyApplication:Application() {


    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        SadCrash.install(this,object : CrashCallback {
            override fun onMainThread(e: Throwable) {
                Log.e("主线程","$e")
            }

            override fun onChildMainThread(thread: Thread, e: Throwable) {
                Log.e("子线程","$e")
            }

        })
    }

}